package com.lanchetech.user.service;


import com.lanchetech.bean.request.LoginReq;
import com.lanchetech.bean.request.RegisterReq;
import com.lanchetech.bean.request.UpdatePasswordByPhoneReq;
import com.lanchetech.bean.response.BaseResp;
import com.lanchetech.bean.response.ResultData;
import com.lanchetech.entity.User;
import com.lanchetech.user.config.JwtAuthenticationRequest;
import org.springframework.security.core.AuthenticationException;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public interface AuthService {

    ResultData<String> register(RegisterReq req);

    ResultData<String> login(LoginReq req);

    ResultData<String> loginByPassword(LoginReq req);

    /**
     * 用户通过openid自动登录
     *
     * @param code
     * @return
     */
    ResultData<String> loginByOpenid(String code);

    ResultData<String> refresh(String oldToken);

    ResultData<String> getKaptchaImage(HttpServletResponse response, HttpSession session) throws Exception;

    BaseResp updatePasswordByPhone(UpdatePasswordByPhoneReq req);

    ResultData<String> wxRegister(RegisterReq req);

    ResultData<String> appRegister(RegisterReq req) throws AuthenticationException;

    ResultData<String> getPhoneStatus(String phone);


    BaseResp updatePayPassword(String payPassword, String code);

    BaseResp loginByPayPassword(String payPassword, Byte type);

    ResultData<Boolean> isPayLogin(User user, Byte type);
}